3.652 \(\int \sec (c+d x) (a+b \tan (c+d x))^n \, dx\)

Optimal. Leaf size=159 \[ \frac{\cos (c+d x) \sqrt{1-\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}}} \sqrt{1-\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}} (a+b \tan (c+d x))^{n+1} F_1\left (n+1;\frac{1}{2},\frac{1}{2};n+2;\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}},\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}\right )}{b d (n+1)} \]

[Out]

(AppellF1[1 + n, 1/2, 1/2, 2 + n, (a + b*Tan[c + d*x])/(a - Sqrt[-b^2]), (a + b*Tan[c + d*x])/(a + Sqrt[-b^2])
]*Cos[c + d*x]*(a + b*Tan[c + d*x])^(1 + n)*Sqrt[1 - (a + b*Tan[c + d*x])/(a - Sqrt[-b^2])]*Sqrt[1 - (a + b*Ta
n[c + d*x])/(a + Sqrt[-b^2])])/(b*d*(1 + n))

________________________________________________________________________________________

Rubi [A]  time = 0.113323, antiderivative size = 159, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {3512, 760, 133} \[ \frac{\cos (c+d x) \sqrt{1-\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}}} \sqrt{1-\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}} (a+b \tan (c+d x))^{n+1} F_1\left (n+1;\frac{1}{2},\frac{1}{2};n+2;\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}},\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}\right )}{b d (n+1)} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]*(a + b*Tan[c + d*x])^n,x]

[Out]

(AppellF1[1 + n, 1/2, 1/2, 2 + n, (a + b*Tan[c + d*x])/(a - Sqrt[-b^2]), (a + b*Tan[c + d*x])/(a + Sqrt[-b^2])
]*Cos[c + d*x]*(a + b*Tan[c + d*x])^(1 + n)*Sqrt[1 - (a + b*Tan[c + d*x])/(a - Sqrt[-b^2])]*Sqrt[1 - (a + b*Ta
n[c + d*x])/(a + Sqrt[-b^2])])/(b*d*(1 + n))

Rule 3512

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[(d^(2
*IntPart[m/2])*(d*Sec[e + f*x])^(2*FracPart[m/2]))/(b*f*(Sec[e + f*x]^2)^FracPart[m/2]), Subst[Int[(a + x)^n*(
1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && NeQ[a^2 + b^2, 0] &&
 !IntegerQ[m/2]

Rule 760

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Rt[-(a*c), 2]}, Dist[(a + c*x^
2)^p/(e*(1 - (d + e*x)/(d + (e*q)/c))^p*(1 - (d + e*x)/(d - (e*q)/c))^p), Subst[Int[x^m*Simp[1 - x/(d + (e*q)/
c), x]^p*Simp[1 - x/(d - (e*q)/c), x]^p, x], x, d + e*x], x]] /; FreeQ[{a, c, d, e, m, p}, x] && NeQ[c*d^2 + a
*e^2, 0] &&  !IntegerQ[p]

Rule 133

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_Symbol] :> Simp[(c^n*e^p*(b*x)^(m +
 1)*AppellF1[m + 1, -n, -p, m + 2, -((d*x)/c), -((f*x)/e)])/(b*(m + 1)), x] /; FreeQ[{b, c, d, e, f, m, n, p},
 x] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[c, 0] && (IntegerQ[p] || GtQ[e, 0])

Rubi steps

\begin{align*} \int \sec (c+d x) (a+b \tan (c+d x))^n \, dx &=\frac{\sec (c+d x) \operatorname{Subst}\left (\int \frac{(a+x)^n}{\sqrt{1+\frac{x^2}{b^2}}} \, dx,x,b \tan (c+d x)\right )}{b d \sqrt{\sec ^2(c+d x)}}\\ &=\frac{\left (\cos (c+d x) \sqrt{1-\frac{a+b \tan (c+d x)}{a-\frac{b^2}{\sqrt{-b^2}}}} \sqrt{1-\frac{a+b \tan (c+d x)}{a+\frac{b^2}{\sqrt{-b^2}}}}\right ) \operatorname{Subst}\left (\int \frac{x^n}{\sqrt{1-\frac{x}{a-\sqrt{-b^2}}} \sqrt{1-\frac{x}{a+\sqrt{-b^2}}}} \, dx,x,a+b \tan (c+d x)\right )}{b d}\\ &=\frac{F_1\left (1+n;\frac{1}{2},\frac{1}{2};2+n;\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}},\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}\right ) \cos (c+d x) (a+b \tan (c+d x))^{1+n} \sqrt{1-\frac{a+b \tan (c+d x)}{a-\sqrt{-b^2}}} \sqrt{1-\frac{a+b \tan (c+d x)}{a+\sqrt{-b^2}}}}{b d (1+n)}\\ \end{align*}

Mathematica [C]  time = 3.75919, size = 340, normalized size = 2.14 \[ \frac{2 (n+2) \left (a^2+b^2\right )^2 \cos ^3(c+d x) (\tan (c+d x)-i) (\tan (c+d x)+i) (a+b \tan (c+d x))^{n+1} F_1\left (n+1;\frac{1}{2},\frac{1}{2};n+2;\frac{a+b \tan (c+d x)}{a-i b},\frac{a+b \tan (c+d x)}{a+i b}\right )}{b d (n+1) (a-i b) (a+i b) \left (2 (n+2) \left (a^2+b^2\right ) F_1\left (n+1;\frac{1}{2},\frac{1}{2};n+2;\frac{a+b \tan (c+d x)}{a-i b},\frac{a+b \tan (c+d x)}{a+i b}\right )+(a+b \tan (c+d x)) \left ((a-i b) F_1\left (n+2;\frac{1}{2},\frac{3}{2};n+3;\frac{a+b \tan (c+d x)}{a-i b},\frac{a+b \tan (c+d x)}{a+i b}\right )+(a+i b) F_1\left (n+2;\frac{3}{2},\frac{1}{2};n+3;\frac{a+b \tan (c+d x)}{a-i b},\frac{a+b \tan (c+d x)}{a+i b}\right )\right )\right )} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[Sec[c + d*x]*(a + b*Tan[c + d*x])^n,x]

[Out]

(2*(a^2 + b^2)^2*(2 + n)*AppellF1[1 + n, 1/2, 1/2, 2 + n, (a + b*Tan[c + d*x])/(a - I*b), (a + b*Tan[c + d*x])
/(a + I*b)]*Cos[c + d*x]^3*(-I + Tan[c + d*x])*(I + Tan[c + d*x])*(a + b*Tan[c + d*x])^(1 + n))/((a - I*b)*(a
+ I*b)*b*d*(1 + n)*(2*(a^2 + b^2)*(2 + n)*AppellF1[1 + n, 1/2, 1/2, 2 + n, (a + b*Tan[c + d*x])/(a - I*b), (a
+ b*Tan[c + d*x])/(a + I*b)] + ((a - I*b)*AppellF1[2 + n, 1/2, 3/2, 3 + n, (a + b*Tan[c + d*x])/(a - I*b), (a
+ b*Tan[c + d*x])/(a + I*b)] + (a + I*b)*AppellF1[2 + n, 3/2, 1/2, 3 + n, (a + b*Tan[c + d*x])/(a - I*b), (a +
 b*Tan[c + d*x])/(a + I*b)])*(a + b*Tan[c + d*x])))

________________________________________________________________________________________

Maple [F]  time = 0.346, size = 0, normalized size = 0. \begin{align*} \int \sec \left ( dx+c \right ) \left ( a+b\tan \left ( dx+c \right ) \right ) ^{n}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)*(a+b*tan(d*x+c))^n,x)

[Out]

int(sec(d*x+c)*(a+b*tan(d*x+c))^n,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c))^n,x, algorithm="maxima")

[Out]

integrate((b*tan(d*x + c) + a)^n*sec(d*x + c), x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (b \tan \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right ), x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c))^n,x, algorithm="fricas")

[Out]

integral((b*tan(d*x + c) + a)^n*sec(d*x + c), x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan{\left (c + d x \right )}\right )^{n} \sec{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c))**n,x)

[Out]

Integral((a + b*tan(c + d*x))**n*sec(c + d*x), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \tan \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((b*tan(d*x + c) + a)^n*sec(d*x + c), x)